/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.pretorius.programs.program08.impl;

import za.ac.cput.pretorius.programs.program08.Encrypter;

/**
 *
 * @author griddy
 */
public class EncrypterImpl implements Encrypter{

    @Override
    public String encrypt(String str) {
        
        String newStr = "";
        
        for(int i = 0 ; i < str.length() ; i++)
        {
           
                newStr += ( (char)(str.charAt(i) + 1) + "");
        }
        
        return newStr;
    }
    
    @Override
    public String decrypt(String str) {
        
        String newStr = "";
        
        for(int i = 0 ; i < str.length() ; i++)
        {
           
                newStr += ( (char)(str.charAt(i) - 1) + "");
        }
        
        return newStr;
    }
    
}
